﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace RFinance.Domain.Entities
{
    public class User
    {
        public virtual String Username { get; set; }
        [Required]
        [Key]
        [RegularExpression("^([\\w-]+(?:\\.[\\w-]+)*)@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)$", ErrorMessage = "Insert a valid e-mail")]
        public virtual String Email { get; set; }
        [Required, DataType(DataType.Password)]
        public virtual String Password { get; set; }
        public ICollection<Conta> Contas { get; set; }
    }
}